package  
{
	
	import starling.text.BitmapFont
	import starling.textures.TextureAtlas;
	import flash.display3D.Context3DTextureFormat
	import starling.textures.Texture
	
		
	/**
	 * ...
	 * @author artem.kolesnikov 
	 */
	public class AtlasHolder 
	{
		
		[Embed(source = "../assets/gui.xml", mimeType = "application/octet-stream")]
		private static const AtlasXml:Class;
 
		// Embed the Atlas Texture:
		[Embed(source="../assets/gui.png")]
		private static const AtlasTexture:Class;
				
		private static var _instance:AtlasHolder;
		
		private static var _atlas:TextureAtlas;
		
		public function AtlasHolder() 
		{
			var texture:Texture = Texture.fromBitmap(new AtlasTexture());
			var xml:XML = XML(new AtlasXml());
			_atlas = new TextureAtlas(texture, xml);
			trace("atlas init");
		}
		
		public static function get instance():AtlasHolder {
			if (!_instance) {
				_instance = new AtlasHolder();
			}
			return _instance;
		}
		
		public function get atlas():TextureAtlas {
			return _atlas;
		}
		
		public function createSimpleImage(resId:String, atlasPath:String = ""):SimpleImage {
			return new SimpleImage(resId);
		}
	}

}